tiny memory leaks
authorparkrrrr <parkrrrr@f51c46e8-681c-474f-0cfe-069cfd0219fb>
Tue, 3 May 2005 16:41:06 +0000 (16:41 +0000)
committerparkrrrr <parkrrrr@f51c46e8-681c-474f-0cfe-069cfd0219fb>
Tue, 3 May 2005 16:41:06 +0000 (16:41 +0000)
gpsbabel/html.c
gpsbabel/vcf.c

index 0b4c5dcbfb5193161befcc6fe55b81cd08230a66..ab72d1c4980cd92184be5b0b248615a8a5ebdb41 100644 (file)
@@ -104,10 +104,14 @@ html_disp(const waypoint *wpt)
        }
        if (wpt->gc_data.terr) {
                if (wpt->gc_data.desc_short.utfstring) {
-                       fprintf (file_out, "<p class=\"descshort\">%s</p>\n", strip_nastyhtml(wpt->gc_data.desc_short.utfstring));
+                       char *tmpstr = strip_nastyhtml(wpt->gc_data.desc_short.utfstring);
+                       fprintf (file_out, "<p class=\"descshort\">%s</p>\n", tmpstr );
+                       xfree( tmpstr );
                        }
                if (wpt->gc_data.desc_long.utfstring) {
-                       fprintf (file_out, "<p class=\"desclong\">%s</p>\n", strip_nastyhtml(wpt->gc_data.desc_long.utfstring));
+                       char *tmpstr = strip_nastyhtml(wpt->gc_data.desc_long.utfstring);
+                       fprintf (file_out, "<p class=\"desclong\">%s</p>\n", tmpstr );
+                       xfree( tmpstr );
                        }
                if (wpt->gc_data.hint) {
                        char *hint = NULL;
index 64fb45cc1f37b4ebe2b1b5705ac55aafc9329193..aa6911accc66370c7a09592bf781f2a8b60f01cd 100644 (file)
@@ -70,6 +70,7 @@ vcf_print_utf(const utf_string *s)
        fputs(p2, file_out);
        xfree(p);
        xfree(p2);
+       xfree(stripped_html);
 }
 
 static void